import { post, del, get } from '@/utils/request'
import { obj2FormData } from '@/utils'

const shop = {
  /**
   * @description 新增商家
   * @param data
   */
  insertShop: data => post('/shop', data, {
	  transformRequest: data => obj2FormData(data),
	  headers: {
	  	'Content-Type': 'multipart/form-data'
	  }
  }),
  /**
	 * @description 修改商家信息
	 * @param id, data
	 */
  deleteShop: (id) => del(`/shop/${id}`),
  /**
	 * @description 获取商家列表
	 * @param data
	 */
  getShop: data => get('/shop', data)
}

export default shop
